package cn.com.lsjz.nursemanager.repository.system;


import java.util.List;

import org.springframework.data.jpa.repository.Query;

import cn.com.lsjz.commons.repository.base.BaseRepository;
import cn.com.lsjz.nursemanager.model.system.HisPatMasterInfor;
import cn.com.lsjz.nursemanager.model.vo.HisPatientMasterInfoVo;


public interface HisPatMasterInforRepository extends BaseRepository<HisPatMasterInfor, Integer>{

	/**
	 * 根据科室号获取对应的患者数据
	 * @param deptCode
	 * @return
	 */
	@Query(" select new cn.com.lsjz.nursemanager.model.vo.HisPatientMasterInfoVo(p.patientId,p.inpNo,p.visitId,p.deptCode,p.deptName,p.admissionTime,p.admdeptTime,p.bedNo,p.bedLabel,p.nurseClass,p.status,"
			+ "p.nurseId,p.nurseName,p.doctorId,p.doctorName,"
			+ "o.patientName,o.patientSex,o.birthDate,o.address,o.phone)"
			+ " from HisPatInHospital p,HisPatMasterInfor o where p.patientId = o.patientId and p.deptCode = ?1 order by p.bedNo ")
	List<HisPatientMasterInfoVo> loadPatientList(String deptCode);

	
		
	
}
